package net.JwtDemo.exception;


import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import lombok.extern.slf4j.Slf4j;
import net.JwtDemo.dto.JsonResult;

@ControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
    
    @ExceptionHandler(RuntimeException.class)
    public JsonResult handleRuntimeException(RuntimeException ex) {
    	log.error("发生异常", ex.getMessage());
    	ex.printStackTrace();
        return new JsonResult("11", ex.getMessage());
    }
}